//package org.myrabbitmqdemo.callback;
//
//import org.springframework.amqp.rabbit.connection.CorrelationData;
//import org.springframework.amqp.rabbit.core.RabbitTemplate;
//
///**
// * @Date 2025/6/12 17:34
// * @Author guangang
// */
//public class MyConfirmCallback implements RabbitTemplate.ConfirmCallback {
//
//    @Override
//    public void confirm(CorrelationData correlationData, boolean ack, String cause) {
//        if (correlationData != null && correlationData.getId().contains("sync")) {
//            if (ack) {
//                System.out.println("消息已成功发送到 MQ: " + correlationData.getId());
//            } else {
//                System.out.println("消息发送失败，原因：" + cause);
//            }
//        }
//    }
//}
